# -*- coding: utf-8 -*-
from scrapy import Spider, Request
from urllib.parse import urlencode
from images360.items import ImageItem
import json

class ImagesSpider(Spider):
    name = 'images'
    allowed_domains = ['images.so.com']
    start_urls = ['https://image.so.com/zj?ch=photography&sn=30&listtype=new&temp=1']

    # 定义 start_requests()方法,用来生成 50次请求
    def start_requests(self):
        # 请求地址栏 url参数的拼接 sn参数由循环遍历生成,
        data = {'ch': 'photography', 'listtype': 'new','temp':1}
        base_url = 'https://image.so.com/zj?'
        for page in range(1, self.settings.get('MAX_PAGE')+1):
            data['sn'] = page * 30
            # 利用 urlencode()方法将字典转化为 url的 get参数,构造出完整的 url
            params = urlencode(data)
            url = base_url + params
            # 构造并生成 Request()
            yield Request(url, self.parse)
         
    def parse(self, response):
#        {"end":false,"count":30,"lastid":60,"list":[{"id":"f07d3d71df4354aebcdd6f165be8ebcf","imageid":"96384384f2ca6186fffd3f111c11a4c2","group_title":"\u68ee\u6797\u8bb0","tag":"\u68ee\u6797","label":"","grpseq":1,"cover_imgurl":"http:\/\/img.hb.aicdn.com\/9fe6ea37824951a8530115864b6808b6a2457e8438ce3-yJRRbo","cover_height":750,"cover_width":499,"total_count":1,"index":31,"qhimg_url":"http:\/\/p0.so.qhmsg.com\/t01fcb3feb9b4e5bc95.jpg","qhimg_thumb_url":"http:\/\/p0.so.qhmsg.com\/sdr\/238__\/t01fcb3feb9b4e5bc95.jpg","qhimg_width":238,"qhimg_height":358,"dsptime":""},{"id":"0e1f6e66d62ad95a74dfa3e7b9802af0","imageid":"8b9cdb934e919b1d2367ed139b066a48","group_title":"\u68ee\u6797","tag":"\u68ee\u6797","label":"","grpseq":1,"cover_imgurl":"http:\/\/img.hb.aicdn.com\/727781f6dee5d4ddc00d94418f4d2e35f6fbf6e0181dc-5ouUrY","cover_height":387,"cover_width":725,"total_count":1,"index":32,"qhimg_url":"http:\/\/p3.so.qhimgs1.com\/t010ce491d185364e53.jpg","qhimg_thumb_url":"http:\/\/p3.so.qhimgs1.com\/sdr\/238__\/t010ce491d185364e53.jpg","qhimg_width":238,"qhimg_height":127,"dsptime":""},{"id":"6ffeb95906f558fd0d7cf4eb16501789","imageid":"6566501e210d9dc5f9d5b722fa513e55","group_title":"\u68ee\u6797","tag":"\u68ee\u6797","label":"","grpseq":1,"cover_imgurl":"http:\/\/img.hb.aicdn.com\/d893a0b30f27bd84eb132432110dd6b0267dc8e81d659-VW6TmL","cover_height":483,"cover_width":725,"total_count":1,"index":33,"qhimg_url":"http:\/\/p0.so.qhimgs1.com\/t01a098025e4214bacc.jpg","qhimg_thumb_url":"http:\/\/p0.so.qhimgs1.com\/sdr\/238__\/t01a098025e4214bacc.jpg","qhimg_width":238,"qhimg_height":159,"dsptime":""},{"id":"c81a614315d9f6c6c12acf25162f8965","imageid":"453c5b967457f3d56510a45b82df8314","group_title":"\u5927\u56f4\u5c71\u5ce1\u8c37\u6f02\u6d41","tag":"\u5ce1\u8c37","label":"","grpseq":1,"cover_imgurl":"http:\/\/m.tuniucdn.com\/filebroker\/cdn\/olb\/49\/40\/49407816cec0940754a3263853213ab1_w1001_h801_c1_t0.jpg","cover_height":1063,"cover_width":1417,"total_count":1,"index":34,"qhimg_url":"http:\/\/p4.so.qhmsg.com\/t0173b4f5e4e93afa19.jpg","qhimg_thumb_url":"http:\/\/p4.so.qhmsg.com\/sdr\/238__\/t0173b4f5e4e93afa19.jpg","qhimg_width":238,"qhimg_height":179,"dsptime":""},{"id":"08f10528bd3a9e29b7fbb031fb995737","imageid":"270fe15b6b3f1bc4726178df73bbe9b4","group_title":"\u4e61\u6751,\u53cd\u5c04,\u6c34,\u963f\u57fa\u5766,\u6cd5\u56fd,\u6b27\u6d32","tag":"\u7530\u56ed,\u5168\u90e8","label":"\u963f\u57fa\u5766,\u6cd5\u56fd,\u6b27\u6d32","grpseq":1,"cover_imgurl":"http:\/\/m2.quanjing.com\/2m\/rob_pre001\/rob-390-2321.jpg","cover_height":741,"cover_width":1024,"total_count":1,"index":35,"qhimg_url":"http:\/\/p0.so.qhimgs1.com\/t01318ee5ebe675f780.jpg","qhimg_thumb_url":"http:\/\/p0.so.qhimgs1.com\/sdr\/238__\/t01318ee5ebe675f780.jpg","qhimg_width":238,"qhimg_height":172,"dsptime":""},{"id":"f8ab4783572c67f0353c38cc34109b72","imageid":"9ca97a3b99261e531ac7ef5035fddc99","group_title":"\u6c5f\u95e8,\u6f6e\u83b2\u522b\u5885","tag":"\u4e2d\u5f0f,\u7530\u56ed,\u5168\u90e8","label":"\u6c5f\u95e8","grpseq":1,"cover_imgurl":"http:\/\/m2.quanjing.com\/2m\/chineseview065\/177-5035.jpg","cover_height":683,"cover_width":1024,"total_count":1,"index":36,"qhimg_url":"http:\/\/p0.so.qhimgs1.com\/t0114078c149d2d4490.jpg","qhimg_thumb_url":"http:\/\/p0.so.qhimgs1.com\/sdr\/238__\/t0114078c149d2d4490.jpg","qhimg_width":238,"qhimg_height":159,"dsptime":""},{"id":"7a31432df6c798598dc3313e23d33430","imageid":"6266c8dc85152a7b9bf30e4b41f27a18","group_title":"\u57ce\u9547,\u897f\u6d77\u5cb8,\u5c9b\u5c7f,\u62c9\u8fea\u6208\u5c9b,\u585e\u820c\u5c14,\u5370\u5ea6\u6d0b,\u975e\u6d32","tag":"\u7530\u56ed,\u5168\u90e8","label":"\u585e\u820c\u5c14,\u5370\u5ea6\u6d0b,\u975e\u6d32","grpseq":1,"cover_imgurl":"http:\/\/m2.quanjing.com\/2m\/rob_her005\/rob-724-394.jpg","cover_height":684,"cover_width":1024,"total_count":1,"index":37,"qhimg_url":"http:\/\/p2.so.qhimgs1.com\/t01f8237d8b54937d2e.jpg","qhimg_thumb_url":"http:\/\/p2.so.qhimgs1.com\/sdr\/238__\/t01f8237d8b54937d2e.jpg","qhimg_width":238,"qhimg_height":159,"dsptime":""},{"id":"727d7d93ef895340603f04ab25d2aaf4","imageid":"9cddbee15d443b00216a79fb2aa6fd63","group_title":"\u56db\u5ddd\u6cf8\u5dde\u53e4\u853a\u53bf\u592a\u5e73\u53e4\u9547","tag":"\u4e2d\u5f0f,\u7530\u56ed,\u5168\u90e8","label":"\u56db\u5ddd,\u6cf8\u5dde,\u53e4\u853a\u53bf,\u53e4\u9547","grpseq":1,"cover_imgurl":"http:\/\/m2.quanjing.com\/2m\/chineseview066\/263-7914.jpg","cover_height":1024,"cover_width":683,"total_count":1,"index":38,"qhimg_url":"http:\/\/p0.so.qhimgs1.com\/t0128bd36b902749ce4.jpg","qhimg_thumb_url":"http:\/\/p0.so.qhimgs1.com\/sdr\/238__\/t0128bd36b902749ce4.jpg","qhimg_width":238,"qhimg_height":357,"dsptime":""},{"id":"307428a602523157a6cff527c32ecd79","imageid":"4ee636302f03ce0a47f723ed31a7df42","group_title":"\u77f3\u5934,\u55b7\u6cc9,\u73a9,\u5e73\u53f0,\u5357\u65b9,\u623f\u5b50","tag":"\u7530\u56ed,\u5168\u90e8","label":"","grpseq":1,"cover_imgurl":"http:\/\/m2.quanjing.com\/2m\/fodrm017\/fod-00700113.jpg","cover_height":683,"cover_width":1024,"total_count":1,"index":39,"qhimg_url":"http:\/\/p0.so.qhimgs1.com\/t01a1e1c80d65676c74.jpg","qhimg_thumb_url":"http:\/\/p0.so.qhimgs1.com\/sdr\/238__\/t01a1e1c80d65676c74.jpg","qhimg_width":238,"qhimg_height":159,"dsptime":""},{"id":"6da843efbac4d67fb0f260d78f23a3d3","imageid":"9d27f1cf844bf4123378035a4ca5c878","group_title":"\u770b,\u5efa\u7b51,\u5c0f\u8def,\u4e2d\u56fd,\u8fd0\u6cb3,\u57ce\u9547,\u4e4c\u9547","tag":"\u4e2d\u5f0f,\u7530\u56ed,\u5168\u90e8","label":"\u4e2d\u56fd,\u4e4c\u9547","grpseq":1,"cover_imgurl":"http:\/\/m2.quanjing.com\/2m\/millen002\/z488_081.jpg","cover_height":1010,"cover_width":1024,"total_count":1,"index":40,"qhimg_url":"http:\/\/p2.so.qhimgs1.com\/t0115ff2dea873b8e92.jpg","qhimg_thumb_url":"http:\/\/p2.so.qhimgs1.com\/sdr\/238__\/t0115ff2dea873b8e92.jpg","qhimg_width":238,"qhimg_height":235,"dsptime":""},{"id":"7fb4893320615d26fc799ae2a4406bed","imageid":"3bab32df52c731d9f0e281cacd17a72b","group_title":"\u4e61\u6751\u522b\u5885","tag":"\u7530\u56ed,\u5168\u90e8","label":"","grpseq":1,"cover_imgurl":"http:\/\/m2.quanjing.com\/2m\/IS010\/IS689-070.jpg","cover_height":1024,"cover_width":684,"total_count":1,"index":41,"qhimg_url":"http:\/\/p0.so.qhimgs1.com\/t0150366939e66736d4.jpg","qhimg_thumb_url":"http:\/\/p0.so.qhimgs1.com\/sdr\/238__\/t0150366939e66736d4.jpg","qhimg_width":238,"qhimg_height":356,"dsptime":""},{"id":"44d442c2b84535a97322e0c0611faf66","imageid":"c4b81c1fa21a2127bdd834423b0214bd","group_title":"\u7f8e\u56fd,\u4f5b\u8499\u7279\u5dde,\u4e2d\u5fc3","tag":"\u7530\u56ed,\u5168\u90e8","label":"\u7f8e\u56fd,\u4f5b\u8499\u7279\u5dde","grpseq":1,"cover_imgurl":"http:\/\/m2.quanjing.com\/2m\/sps030\/sps255-424044.jpg","cover_height":1024,"cover_width":802,"total_count":1,"index":42,"qhimg_url":"http:\/\/p0.so.qhimgs1.com\/t01562074f7a15791a0.jpg","qhimg_thumb_url":"http:\/\/p0.so.qhimgs1.com\/sdr\/238__\/t01562074f7a15791a0.jpg","qhimg_width":238,"qhimg_height":304,"dsptime":""},{"id":"38da831ee97abda9fff102cc7cc12af5","imageid":"8a636243c827a7c6dab86a4b9589cd55","group_title":"\u9760\u8fd1,\u7231\u5c14\u5170","tag":"\u7530\u56ed,\u5168\u90e8","label":"\u7231\u5c14\u5170","grpseq":1,"cover_imgurl":"http:\/\/m2.quanjing.com\/2m\/irish_rm001\/isish1820294.jpg","cover_height":1024,"cover_width":677,"total_count":1,"index":43,"qhimg_url":"http:\/\/p1.so.qhimgs1.com\/t0186498adf9ccf2821.jpg","qhimg_thumb_url":"http:\/\/p1.so.qhimgs1.com\/sdr\/238__\/t0186498adf9ccf2821.jpg","qhimg_width":238,"qhimg_height":360,"dsptime":""},{"id":"6d52a394b292173f7443c9286cad98ae","imageid":"3c1c85d76042afbc39cba54b26357e45","group_title":"\u6b27\u6d32,\u6ce2\u5170,\u5580\u5c14\u5df4\u9621\u5c71\u8109,\u4e61\u6751,\u98ce\u666f,\u6cb3","tag":"\u7530\u56ed,\u5168\u90e8","label":"\u6b27\u6d32,\u6ce2\u5170","grpseq":1,"cover_imgurl":"http:\/\/m2.quanjing.com\/2m\/danita_rm005\/eu22-wbi0134.jpg","cover_height":680,"cover_width":1024,"total_count":1,"index":44,"qhimg_url":"http:\/\/p0.so.qhmsg.com\/t0112afd48af05f0175.jpg","qhimg_thumb_url":"http:\/\/p0.so.qhmsg.com\/sdr\/238__\/t0112afd48af05f0175.jpg","qhimg_width":238,"qhimg_height":158,"dsptime":""},{"id":"f96aac8e56dedefc5b8e1f9b16bce30e","imageid":"01c8619756e2e0b50075f50195232060","group_title":"\u519c\u820d,\u8349\u5730,\u5c9b\u5c7f,\u9a6c\u683c\u8fbe\u4f26\u7fa4\u5c9b,\u9b41\u5317\u514b,\u52a0\u62ff\u5927,\u5317\u7f8e","tag":"\u7530\u56ed,\u5168\u90e8","label":"\u9b41\u5317\u514b,\u52a0\u62ff\u5927,\u5317\u7f8e","grpseq":1,"cover_imgurl":"http:\/\/m2.quanjing.com\/2m\/ibrm038\/iblest01491901.jpg","cover_height":680,"cover_width":1024,"total_count":1,"index":45,"qhimg_url":"http:\/\/p2.so.qhimgs1.com\/t012cbf9197f26edcfe.jpg","qhimg_thumb_url":"http:\/\/p2.so.qhimgs1.com\/sdr\/238__\/t012cbf9197f26edcfe.jpg","qhimg_width":238,"qhimg_height":158,"dsptime":""},{"id":"7f8d9332c1113db2fd3bbb2eb3284a32","imageid":"15dccf91cf2898535eef1edfa522cecd","group_title":"\u5c0f\u5c4b,\u74e6\u7eb3\u5361,\u4e2d\u5fc3,\u5965\u5854\u54e5,\u5357\u5c9b,\u65b0\u897f\u5170,\u592a\u5e73\u6d0b","tag":"\u7530\u56ed,\u7b80\u7ea6,\u5168\u90e8","label":"\u5357\u5c9b,\u65b0\u897f\u5170,\u592a\u5e73\u6d0b","grpseq":1,"cover_imgurl":"http:\/\/m2.quanjing.com\/2m\/rob_pre003\/rob-756-311.jpg","cover_height":1024,"cover_width":680,"total_count":1,"index":46,"qhimg_url":"http:\/\/p4.so.qhmsg.com\/t0152e2e8f4718f2db9.jpg","qhimg_thumb_url":"http:\/\/p4.so.qhmsg.com\/sdr\/238__\/t0152e2e8f4718f2db9.jpg","qhimg_width":238,"qhimg_height":358,"dsptime":""},{"id":"bc741704b20475dd28f3f70c211f966b","imageid":"ec8de8f49c6860eb0ea3ef4b2d66da5f","group_title":"\u6559\u5802,\u8461\u8404\u56ed,\u6c49\u62ff\u5a01,\u963f\u5c14\u8428\u65af,\u6cd5\u56fd,\u6b27\u6d32","tag":"\u7530\u56ed,\u5168\u90e8","label":"\u963f\u5c14\u8428\u65af,\u6cd5\u56fd,\u6b27\u6d32","grpseq":1,"cover_imgurl":"http:\/\/m2.quanjing.com\/2m\/rob_pre001\/rob-526-29.jpg","cover_height":1024,"cover_width":684,"total_count":1,"index":47,"qhimg_url":"http:\/\/p1.so.qhmsg.com\/t0185825e12eb6af026.jpg","qhimg_thumb_url":"http:\/\/p1.so.qhmsg.com\/sdr\/238__\/t0185825e12eb6af026.jpg","qhimg_width":238,"qhimg_height":356,"dsptime":""},{"id":"d22b7f32fb3122b9b77582d4728679c6","imageid":"9ea2700ff8c840c8f3ca2fe6f842e1c1","group_title":"\u4fef\u89c6,\u897f\u90e8,\u6d77\u5cb8,\u83ab\u5c14\u6bd4\u6602\u7701,\u6d77\u6e7e,\u5e03\u5217\u5854\u5c3c\u534a\u5c9b,\u6cd5\u56fd,\u6b27\u6d32","tag":"\u7530\u56ed,\u73b0\u4ee3,\u5168\u90e8","label":"\u6cd5\u56fd,\u6b27\u6d32","grpseq":1,"cover_imgurl":"http:\/\/m2.quanjing.com\/2m\/rob_pre002\/rob-724-1243.jpg","cover_height":684,"cover_width":1024,"total_count":1,"index":48,"qhimg_url":"http:\/\/p0.so.qhmsg.com\/t013b537a3daeefb385.jpg","qhimg_thumb_url":"http:\/\/p0.so.qhmsg.com\/sdr\/238__\/t013b537a3daeefb385.jpg","qhimg_width":238,"qhimg_height":159,"dsptime":""},{"id":"9fe1a21625807975aa7dde98644771ff","imageid":"ed483df1cf4dd89ed0b2d30bc7be81fc","group_title":"\u623f\u5c4b\u51fa\u552e\u963f\u5c14\u4ee3\u4ec0\u6cd5\u56fd","tag":"\u7530\u56ed,\u5168\u90e8","label":"\u6cd5\u56fd","grpseq":1,"cover_imgurl":"http:\/\/m2.quanjing.com\/2m\/sps022\/sps4285-14174.jpg","cover_height":1024,"cover_width":1024,"total_count":1,"index":49,"qhimg_url":"http:\/\/p0.so.qhimgs1.com\/t011200e77aa6037674.jpg","qhimg_thumb_url":"http:\/\/p0.so.qhimgs1.com\/sdr\/238__\/t011200e77aa6037674.jpg","qhimg_width":238,"qhimg_height":238,"dsptime":""},{"id":"dd9e5c2296251d373e03ae734c9d5d7a","imageid":"da6bed12683eef16c1d9c58fe7ad9fbb","group_title":"\u4e61\u6751,\u9152\u5e97,\u5df4\u5229\u963f\u91cc\u7fa4\u5c9b,\u897f\u73ed\u7259","tag":"\u5367\u5ba4,\u7530\u56ed,\u5168\u90e8","label":"\u897f\u73ed\u7259","grpseq":1,"cover_imgurl":"http:\/\/m2.quanjing.com\/2m\/age_foto49\/x3l-997269.jpg","cover_height":590,"cover_width":900,"total_count":1,"index":50,"qhimg_url":"http:\/\/p2.so.qhimgs1.com\/t01e558ff689d08f26e.jpg","qhimg_thumb_url":"http:\/\/p2.so.qhimgs1.com\/sdr\/238__\/t01e558ff689d08f26e.jpg","qhimg_width":238,"qhimg_height":156,"dsptime":""},{"id":"94822fb86e14a49abd008858aa836c31","imageid":"17622bab1588a02dfb9aeffda47e19e7","group_title":"\u4f20\u7edf,\u7a46\u65af\u6797,\u5893\u7891,\u5973\u4eba,\u5893\u5730,\u82b1,\u6570\u5b57,\u5b69\u5b50,\u4e61\u6751,\u4f0a\u65af\u5766\u5e03\u5c14,\u571f\u8033\u5176","tag":"\u4e2d\u5f0f,\u7530\u56ed,\u5168\u90e8","label":"\u7a46\u65af\u6797,\u4f0a\u65af\u5766\u5e03\u5c14,\u571f\u8033\u5176","grpseq":1,"cover_imgurl":"http:\/\/m2.quanjing.com\/2m\/ibrm001\/iblkas01173720.jpg","cover_height":1024,"cover_width":683,"total_count":1,"index":51,"qhimg_url":"http:\/\/p0.so.qhimgs1.com\/t0192276d67580adc70.jpg","qhimg_thumb_url":"http:\/\/p0.so.qhimgs1.com\/sdr\/238__\/t0192276d67580adc70.jpg","qhimg_width":238,"qhimg_height":357,"dsptime":""},{"id":"599a11bff522f8b932db99a25a10aed6","imageid":"78f98dae374b0e929b069f187f0a7f42","group_title":"\u89c2\u6d4b,\u7231\u5c14\u5170,18\u4e16\u7eaa,\u8bbe\u8ba1","tag":"\u7530\u56ed,\u5168\u90e8","label":"\u7231\u5c14\u5170","grpseq":1,"cover_imgurl":"http:\/\/m2.quanjing.com\/2m\/irish_rm001\/isish1804504.jpg","cover_height":834,"cover_width":1024,"total_count":1,"index":52,"qhimg_url":"http:\/\/p0.so.qhmsg.com\/t010134a1850275470f.jpg","qhimg_thumb_url":"http:\/\/p0.so.qhmsg.com\/sdr\/238__\/t010134a1850275470f.jpg","qhimg_width":238,"qhimg_height":194,"dsptime":""},{"id":"a4ffafaae00874173ec3675072e0a34d","imageid":"3e44320ff545e7cec1dee2eaa0ebe8d0","group_title":"\u6f02\u4eae,\u89d2,\u57ce\u9547,\u6bd4\u5229\u725b\u65af,\u6cd5\u56fd,\u6b27\u6d32","tag":"\u7530\u56ed,\u5168\u90e8","label":"\u6bd4\u5229\u725b\u65af,\u6cd5\u56fd,\u6b27\u6d32","grpseq":1,"cover_imgurl":"http:\/\/m2.quanjing.com\/2m\/rob_pre001\/rob-390-2430.jpg","cover_height":679,"cover_width":1024,"total_count":1,"index":53,"qhimg_url":"http:\/\/p2.so.qhimgs1.com\/t018ce156cad75a51e2.jpg","qhimg_thumb_url":"http:\/\/p2.so.qhimgs1.com\/sdr\/238__\/t018ce156cad75a51e2.jpg","qhimg_width":238,"qhimg_height":158,"dsptime":""},{"id":"159480f29dcd849331de9d6f56515412","imageid":"b39890e53e6373743417644a644b5336","group_title":"\u519c\u6751\u53a8\u623f","tag":"\u53a8\u623f,\u7530\u56ed,\u5168\u90e8","label":"","grpseq":1,"cover_imgurl":"http:\/\/m2.quanjing.com\/2m\/fsi001\/fsi-009017.jpg","cover_height":1024,"cover_width":959,"total_count":1,"index":54,"qhimg_url":"http:\/\/p2.so.qhimgs1.com\/t01dfcdd4d418660f32.jpg","qhimg_thumb_url":"http:\/\/p2.so.qhimgs1.com\/sdr\/238__\/t01dfcdd4d418660f32.jpg","qhimg_width":238,"qhimg_height":254,"dsptime":""},{"id":"d99a51a5f12ced1aabddcb7c87eb29c6","imageid":"a019055dbdfcd9864e60d2248fda4b90","group_title":"\u6728,\u5ba4\u5185,\u751f\u52a8,\u7a7a\u95f4\u611f,\u5ba2\u5385","tag":"\u5ba2\u5385,\u7530\u56ed,\u5168\u90e8","label":"","grpseq":1,"cover_imgurl":"http:\/\/m2.quanjing.com\/2m\/fodrm016\/fod-00722917.jpg","cover_height":683,"cover_width":1024,"total_count":1,"index":55,"qhimg_url":"http:\/\/p2.so.qhimgs1.com\/t01e292fab2e8fdc952.jpg","qhimg_thumb_url":"http:\/\/p2.so.qhimgs1.com\/sdr\/238__\/t01e292fab2e8fdc952.jpg","qhimg_width":238,"qhimg_height":159,"dsptime":""},{"id":"8f09722cf10a1a4979771da4ba451010","imageid":"db8ab15788f8727e0b7adde2b0da9f8b","group_title":"\u592a\u9633,\u4e61\u6751,\u5c4b\u9876,\u5df4\u767b\u7b26\u817e\u5821,\u5fb7\u56fd,\u6b27\u6d32","tag":"\u7530\u56ed,\u5168\u90e8","label":"\u5fb7\u56fd,\u6b27\u6d32","grpseq":1,"cover_imgurl":"http:\/\/m2.quanjing.com\/2m\/ibrm046\/ibldjs01299976.jpg","cover_height":680,"cover_width":1024,"total_count":1,"index":56,"qhimg_url":"http:\/\/p0.so.qhimgs1.com\/t01b86b53a1d1062db0.jpg","qhimg_thumb_url":"http:\/\/p0.so.qhimgs1.com\/sdr\/238__\/t01b86b53a1d1062db0.jpg","qhimg_width":238,"qhimg_height":158,"dsptime":""},{"id":"6ea9e17d0f018d8c96e890d0f37dd57a","imageid":"2afa5422ba7c23a342c2d226029eced4","group_title":"\u65e5\u843d,\u6e2f\u53e3,\u7ebd\u82ac\u5170,\u52a0\u62ff\u5927","tag":"\u7530\u56ed,\u5168\u90e8","label":"\u7ebd\u82ac\u5170,\u52a0\u62ff\u5927","grpseq":1,"cover_imgurl":"http:\/\/m2.quanjing.com\/2m\/acp002\/acp-acp05367.jpg","cover_height":677,"cover_width":1024,"total_count":1,"index":57,"qhimg_url":"http:\/\/p1.so.qhimgs1.com\/t017c7e83da4ddad92d.jpg","qhimg_thumb_url":"http:\/\/p1.so.qhimgs1.com\/sdr\/238__\/t017c7e83da4ddad92d.jpg","qhimg_width":238,"qhimg_height":157,"dsptime":""},{"id":"9b7aa0223783a2812141aad81edb0fbf","imageid":"521c5e27621f3d787ddf6a5caf9acadb","group_title":"\u4e61\u6751,\u4e1c\u65b9,\u6c49\u666e\u987f,\u957f\u5c9b,\u7ebd\u7ea6,\u7f8e\u56fd,\u5317\u7f8e","tag":"\u4e2d\u5f0f,\u7530\u56ed,\u5168\u90e8","label":"\u4e1c\u65b9,\u957f\u5c9b,\u7ebd\u7ea6,\u7f8e\u56fd,\u5317\u7f8e","grpseq":1,"cover_imgurl":"http:\/\/m2.quanjing.com\/2m\/rob_pre001\/rob-641-11532.jpg","cover_height":1024,"cover_width":681,"total_count":1,"index":58,"qhimg_url":"http:\/\/p0.so.qhimgs1.com\/t01bccdb163ccf89ea0.jpg","qhimg_thumb_url":"http:\/\/p0.so.qhimgs1.com\/sdr\/238__\/t01bccdb163ccf89ea0.jpg","qhimg_width":238,"qhimg_height":358,"dsptime":""},{"id":"c29352d431ebf5bed3ca7a4bea7f3a40","imageid":"040df5e33246cece56933c9f87db4171","group_title":"\u91ce\u8425\u8f66,\u505c\u6b62,\u4fa7\u9762,\u9053\u8def,\u6237\u5916,\u79d1\u591a\u5df4,\u963f\u6839\u5ef7","tag":"\u7530\u56ed,\u5168\u90e8","label":"\u963f\u6839\u5ef7","grpseq":1,"cover_imgurl":"http:\/\/m2.quanjing.com\/2m\/design_rf005\/designrf1894024.jpg","cover_height":686,"cover_width":1024,"total_count":1,"index":59,"qhimg_url":"http:\/\/p1.so.qhimgs1.com\/t0112d70d1a39b0a311.jpg","qhimg_thumb_url":"http:\/\/p1.so.qhimgs1.com\/sdr\/238__\/t0112d70d1a39b0a311.jpg","qhimg_width":238,"qhimg_height":159,"dsptime":""},{"id":"6abe3fd284f76cf0a98f12e875812dbb","imageid":"2b15246110568c23b2bc732c1723caf6","group_title":"\u9ad8\u5c71\u7267\u573a,\u6c83\u5dde,\u745e\u58eb,\u6b27\u6d32","tag":"\u7530\u56ed,\u5168\u90e8","label":"\u745e\u58eb,\u6b27\u6d32","grpseq":1,"cover_imgurl":"http:\/\/m2.quanjing.com\/2m\/rob_her007\/rob-728-4954.jpg","cover_height":1024,"cover_width":683,"total_count":1,"index":60,"qhimg_url":"http:\/\/p0.so.qhimgs1.com\/t01c8b7b000cdb7b044.jpg","qhimg_thumb_url":"http:\/\/p0.so.qhimgs1.com\/sdr\/238__\/t01c8b7b000cdb7b044.jpg","qhimg_width":238,"qhimg_height":357,"dsptime":""}]}
        # response.text 返回的是一个 unicode 型的文本数据(str)
        html = response.text
        # 转换成 json字符串
        result = json.loads(html)
        for image in result.get('list'):
            item = ImageItem()
            item['id'] = image.get('imageid')             # 图片ID
            item['url'] = image.get('qhimg_url')          # 链接
            item['title'] = image.get('group_title')      # 标题
            item['thumb'] = image.get('qhimg_thumb_url')  # 缩略图
            yield item

